home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / ed / ed.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-13  |  3.2 KB  |  133 lines

  1. /*
  2. ** ed.h
  3. **
  4. ** Ed, Version 1.51, Copyright (c) 1992-94 SoftCircuits
  5. ** Redistributed by permission.
  6. */
  7.  
  8. /* data structure for line buffers */
  9. typedef struct _LINE {
  10.     struct _LINE *prev;    /* pointer to previous line */
  11.     struct _LINE *next;    /* pointer to next line */
  12.     int len;             /* length of line */
  13.     char text[1];        /* line text */
  14. } LINE;
  15.  
  16. #define UPDATE_NOUPDATE   0
  17. #define UPDATE_REPAINT    1
  18. #define UPDATE_SCROLLUP   2
  19. #define UPDATE_SCROLLDN   3
  20.  
  21. #define NEXT_TAB(_c) (_c + (tab_size - (_c % tab_size)))
  22.  
  23. #define CTRL_PGUP     0x8400
  24. #define CTRL_PGDN    0x7600
  25. #define CTRL_HOME    0x7700
  26. #define CTRL_END     0x7500
  27. #define CTRL_Y       0x1519
  28. #define CTRL_F1      0x5E00
  29. #define CTRL_F2      0x5F00
  30.  
  31. #define EDIT_ROWS        ((edit_bottom - edit_top) + 1)
  32. #define EDIT_COLS        ((edit_right - edit_left) + 1)
  33.  
  34. extern int edit_top,edit_bottom,edit_left,edit_right;
  35.  
  36. extern LINE *head;
  37. extern LINE *tail;
  38. extern LINE *curr_line;
  39. extern LINE *top_line;
  40.  
  41. extern int tab_size;
  42. extern int insert_mode;
  43. extern int num_lines;
  44. extern int line_ndx;
  45. extern int file_row;
  46. extern int file_col;
  47. extern int pref_col;
  48. extern int top_row;
  49. extern int left_col;
  50. extern int update_state;
  51. extern int modified;
  52.  
  53. extern char *copyright;
  54. extern MAINMENU mainmenu[];
  55. extern char filename[];
  56. extern char untitled[];
  57. extern char buffer[];
  58.  
  59. extern VIDEOSTRUCT vcfg;
  60. extern COLORSTRUCT msgcolors;
  61. extern COLORSTRUCT mnucolors;
  62. extern int edit_color;
  63. extern int status_color;
  64. extern int message_color;
  65.  
  66. /* help topics */
  67. extern char hlp_general[];
  68. extern char hlp_new[],hlp_open[],hlp_save[],hlp_saveas[];
  69. extern char hlp_print[],hlp_exit[];
  70. extern char hlp_find[],hlp_change[],hlp_repeatfind[];
  71. extern char hlp_tabwidth[];
  72. extern char hlp_usinghlp[],hlp_index[],hlp_about[];
  73. extern char hlp_filemenu[],hlp_searchmenu[];
  74. extern char hlp_optionsmenu[],hlp_helpmenu[];
  75.  
  76.  
  77. /* ed.c prototypes */
  78. void outofmemory();
  79. int expand_line(LINE **,int,int);
  80. void shrink_line(LINE **,int,int);
  81. void split_line(void);
  82. void join_line(void);
  83. void delete_line(void);
  84. void delete_char(void);
  85. void backspace_char(void);
  86. void insert_char(char c);
  87. void show_usage(void);
  88. void terminate(void);
  89.  
  90. /* navigate.c prototypes */
  91. void show_status(void);
  92. void show_line(LINE *,int);
  93. void show_text(void);
  94. void set_file_col(void);
  95. void set_line_ndx(void);
  96. void update_cursor(int);
  97. void _left(void);
  98. void _right(void);
  99. void _up(void);
  100. void _down(void);
  101. void cursor_left(void);
  102. void cursor_right(void);
  103. void cursor_up(void);
  104. void cursor_down(void);
  105. void page_up(void);
  106. void page_down(void);
  107. void file_home(void);
  108. void file_end(void);
  109.  
  110. /* buffers.c prototypes */
  111. void free_list(void);
  112. void remove_from_list(LINE *);
  113. void add_to_list(LINE *,LINE *);
  114. void append_line(LINE *);
  115. void new_file(char *);
  116. void load_file(char *);
  117. int save_file(char *);
  118.  
  119. /* commands.c */
  120. void using_help(void);
  121. void help_index(void);
  122. void about(void);
  123. void set_tabwidth(void);
  124. int save_modified(void);
  125. void filenew(void);
  126. void fileopen(void);
  127. void filesave(void);
  128. void filesaveas(void);
  129. void fileprint(void);
  130. void search(void);
  131. void change(void);
  132. void repeatsearch(void);
  133.